<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>交税</title>
    <script>
         function jiao(money) {
             let  shui=0;
            if(money<=3500){
                shui=0;
            }
            else if(3500<money&&money<=8000){
                shui=(money-3500)*0.02;
            }else if(8000<money&&money<=20000){
                shui=4500*0.02+(money-8000)*0.05
            }else if(money>20000){
                shui=8000*0.02+20000*0.05+(money-20000)*0.1
            }
               document.write("应交税"+shui+"元");

         }
    </script>
</head>
<body>
<input type="button" value="交税" onclick="jiao(prompt('请输入要交税的钱'))">
</body>
</html>